package com.zegome.game.gomestory.main.scene.play.board;

public class RecCp {
	Board board;
	
	float tick;	
	
	public RecCp(Board board) {
		this.board = board;			
	}
	
	public void update(float pDeltaTime){
		if(tick >= 5.0f ){
			tick = 0;			
			boolean isOld = false;
			for(int i=0;i<10;i++){
				for(int j=0;j<14;j++){
					if(board.dataMap.map[i][j].isSlash == true){
						isOld = true;
						break;
					}
				}
			}
			if(isOld){}
			else{
				int[] data = board.searchEat.search();
				if(data != null){
				board.dataMap.map[data[0]][data[1]].setSlash(true);
				board.dataMap.map[data[2]][data[3]].setSlash(true);
				}
			}
		}
		else{			
			tick+=pDeltaTime;
		}
	}
	
	public void reset(){
		tick = 0;
		for(int i=0;i<10;i++){
			for(int j=0;j<14;j++){
				board.dataMap.map[i][j].setSlash(false);
			}
		}
	}
}
